/**
 * @TestMovieClioBmp.as
 * 
 * @author sodaChen mail:asframe@qq.com
 * @version 1.0
 * <br>Copyright (C), 2010-2016 asFrame.com
 * <br>This program is protected by copyright laws.
 * <br>Program Name:ASFrame
 * <br>Date:2016-5-19
 */
package
{
	import com.asframe.display.movie.MovieClipBmp;
	
	import flash.display.Loader;
	import flash.display.MovieClip;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.Event;
	
	/**
	 *
	 * @author sodaChen
	 * Date:2016-5-19
	 */
	public class TestMovieClioBmp extends Sprite
	{
		private var loader:Loader;
		public function TestMovieClioBmp()
		{
			super();
//			ResManager.load("../assets/ren.swf",onMovieClip);
			loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoader);
//			loader.load(new URLRequest("../assets/ren.swf"));
			
			addShape(50,50,16);
			addShape(50,100,24);
			addShape(50,150,32);
			addShape(50,200,64);
		}
		private function addShape(xx:int,yy:int,value:int):void
		{
			var shape:Shape = new Shape();
			shape.graphics.beginFill(0xffccaa,1);
			shape.graphics.drawRect(xx,yy,value,value);
			shape.graphics.endFill();
			addChild(shape);
		}
		private function onLoader(event:Event):void
		{var mc:MovieClip = loader.content as MovieClip;
			onMovieClip(mc);
			
		}
		private function onMovieClip(mc:MovieClip):void
		{
			var movieBmp:MovieClipBmp = new MovieClipBmp();
			movieBmp.frameRate = 75;
			movieBmp.setResMovie(mc,MovieClipBmp.BITMAP_TPYE);
			movieBmp.setLocation(100,100);
			addChild(movieBmp);
			movieBmp.play(true);
		}
	}
}